<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 电影票预订系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
     <style>
        :root {
            --primary-color: #9d4edd;
            --secondary-color: #5a189a;
            --accent-color: #ff6b6b;
            --dark-color: #10002b;
            --light-color: #f8f9fa;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            position: relative;
            overflow-x: hidden;
        }
        
        /* 电影胶片效果装饰 */
        .film-strip {
            position: absolute;
            width: 100%;
            height: 30px;
            background: repeating-linear-gradient(
                90deg,
                #000 0px,
                #000 15px,
                #333 15px,
                #333 30px
            );
            opacity: 0.3;
            z-index: 1;
        }
        
        .film-strip-top {
            top: 0;
        }
        
        .film-strip-bottom {
            bottom: 0;
        }
        
        .login-container {
            max-width: 1200px;
            width: 100%;
            display: flex;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
            overflow: hidden;
            z-index: 2;
            position: relative;
        }
        
        .login-hero {
            flex: 1;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            padding: 50px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: white;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .login-hero::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }
        
        .hero-content {
            position: relative;
            z-index: 2;
            max-width: 500px;
        }
        
        .hero-content h1 {
            font-size: 3.5rem;
            font-weight: 700;
            margin-bottom: 20px;
            text-shadow: 0 4px 8px rgba(0,0,0,0.3);
            letter-spacing: 1px;
        }
        
        .hero-content p {
            font-size: 1.2rem;
            opacity: 0.9;
            margin-bottom: 30px;
            line-height: 1.6;
        }
        
        .hero-movie-icons {
            display: flex;
            justify-content: center;
            gap: 25px;
            margin-top: 40px;
        }
        
        .hero-movie-icons i {
            font-size: 3.5rem;
            opacity: 0.8;
            transition: all 0.3s ease;
        }
        
        .hero-movie-icons i:hover {
            transform: translateY(-10px) scale(1.2);
            opacity: 1;
        }
        
        .login-card {
            width: 450px;
            padding: 60px 40px;
            position: relative;
        }
        
        .login-header {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .login-header h2 {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--secondary-color);
            margin-bottom: 10px;
        }
        
        .login-header p {
            color: #666;
            font-size: 1.1rem;
        }
        
        .form-group {
            margin-bottom: 25px;
            position: relative;
        }
        
        .form-group label {
            display: flex;
            align-items: center;
            color: var(--secondary-color);
            font-weight: 600;
            margin-bottom: 8px;
            font-size: 1.05rem;
        }
        
        .form-group label i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
            color: var(--primary-color);
        }
        
        .form-control {
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            padding: 14px 15px 14px 45px;
            height: 55px;
            transition: all 0.3s ease;
            font-size: 1rem;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
        }
        
        .input-icon {
            position: absolute;
            left: 15px;
            top: 40px;
            color: #777;
            font-size: 1.2rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus + .input-icon {
            color: var(--primary-color);
            transform: scale(1.1);
        }
        
        .btn-login {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            border: none;
            border-radius: 10px;
            padding: 16px;
            font-size: 1.2rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            box-shadow: 0 6px 18px rgba(154, 96, 212, 0.4);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            color: white;
            width: 100%;
            margin-top: 10px;
        }
        
        .btn-login:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 25px rgba(154, 96, 212, 0.6);
        }
        
        .btn-login:active {
            transform: translateY(1px);
        }
        
        .btn-login::after {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: rgba(255, 255, 255, 0.2);
            transform: rotate(30deg);
            transition: all 0.5s ease;
            opacity: 0;
        }
        
        .btn-login:hover::after {
            opacity: 1;
            top: -20%;
            left: -20%;
        }
        
        .form-check-input:checked {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .form-check-label {
            color: #555;
            font-size: 1rem;
        }
        
        .login-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 20px 0 30px;
        }
        
        .forgot-password {
            color: var(--primary-color);
            font-weight: 600;
            text-decoration: none;
            transition: all 0.3s ease;
            position: relative;
            font-size: 0.95rem;
        }
        
        .forgot-password::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -2px;
            left: 0;
            background-color: var(--primary-color);
            transition: width 0.3s ease;
        }
        
        .forgot-password:hover {
            color: var(--secondary-color);
        }
        
        .forgot-password:hover::after {
            width: 100%;
        }
        
        .register-link {
            text-align: center;
            margin-top: 30px;
            color: #666;
            font-size: 1.05rem;
        }
        
        .register-link a {
            color: var(--primary-color);
            font-weight: 700;
            text-decoration: none;
            transition: all 0.3s ease;
            position: relative;
            margin-left: 5px;
            font-size: 1.1rem;
        }
        
        .register-link a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -2px;
            left: 0;
            background-color: var(--primary-color);
            transition: width 0.3s ease;
        }
        
        .register-link a:hover {
            color: var(--secondary-color);
        }
        
        .register-link a:hover::after {
            width: 100%;
        }
        
        .error-message {
            color: #dc3545;
            font-size: 0.9rem;
            margin-top: 6px;
            display: block;
            padding-left: 35px;
        }
        
        .password-toggle {
            position: absolute;
            right: 15px;
            top: 42px;
            cursor: pointer;
            color: #aaa;
            transition: all 0.3s;
            font-size: 1.2rem;
        }
        
        .password-toggle:hover {
            color: var(--primary-color);
        }
        
        .movie-icon {
            position: absolute;
            right: -20px;
            bottom: -20px;
            font-size: 8rem;
            opacity: 0.05;
            z-index: 0;
            color: var(--secondary-color);
        }
        
        .social-login {
            margin-top: 30px;
            text-align: center;
        }
        
        .social-login p {
            position: relative;
            color: #777;
            margin-bottom: 20px;
        }
        
        .social-login p::before,
        .social-login p::after {
            content: "";
            position: absolute;
            top: 50%;
            width: 30%;
            height: 1px;
            background: #ddd;
        }
        
        .social-login p::before {
            left: 0;
        }
        
        .social-login p::after {
            right: 0;
        }
        
        .social-icons {
            display: flex;
            justify-content: center;
            gap: 20px;
        }
        
        .social-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f5f5f5;
            color: #555;
            font-size: 1.3rem;
            transition: all 0.3s ease;
            box-shadow: 0 3px 10px rgba(0,0,0,0.08);
        }
        
        .social-icon:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 15px rgba(0,0,0,0.15);
        }
        
        .social-icon.facebook:hover {
            background: #3b5998;
            color: white;
        }
        
        .social-icon.google:hover {
            background: #dd4b39;
            color: white;
        }
        
        .social-icon.twitter:hover {
            background: #1da1f2;
            color: white;
        }
        
        @media (max-width: 992px) {
            .login-container {
                flex-direction: column;
            }
            
            .login-hero {
                padding: 30px 20px;
            }
            
            .hero-content h1 {
                font-size: 2.5rem;
            }
            
            .login-card {
                width: 100%;
                padding: 40px 30px;
            }
        }
        
        @media (max-width: 576px) {
            .login-hero {
                display: none;
            }
            
            .login-card {
                padding: 30px 20px;
            }
            
            .login-header h2 {
                font-size: 2rem;
            }
            
            .form-control {
                padding: 12px 15px 12px 40px;
                height: 50px;
            }
        }
    </style>
</head>
<body>
    <!-- 电影胶片装饰 -->
    <div class="film-strip film-strip-top"></div>
    <div class="film-strip film-strip-bottom"></div>
    
    <div class="login-container">
        <div class="login-hero">
            <div class="hero-content">
                <h1><i class="fas fa-ticket-alt"></i> 在线电影票预订系统</h1>
                <p>探索最新电影，预订您的座位，享受非凡的观影体验。加入我们数百万用户的社区，开启您的电影之旅！</p>
                
                <div class="hero-movie-icons">
                    <i class="fas fa-film"></i>
                    <i class="fas fa-video"></i>
                    <i class="fas fa-theater-masks"></i>
                    <i class="fas fa-popcorn"></i>
                </div>
            </div>
        </div>
        
        <div class="login-card">
            <div class="login-header">
                <h2>欢迎回来</h2>
                <p>登录您的账号，继续电影之旅</p>
            </div>
            
            <!-- 显示Flash消息 -->
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }} alert-dismissible fade show mb-4" role="alert">
                            {{ message }}
                            <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endwith %}
            
    <form method="POST" action="{{ url_for('auth.login') }}">
    {{ form.hidden_tag() }}
    <div class="form-group">
        <label for="username">用户名或邮箱</label>  <!-- 修改标签 -->
        <div class="position-relative">
            <i class="fas fa-user input-icon"></i>
            {{ form.username(class="form-control", id="username", placeholder="请输入用户名或邮箱") }}
        </div>
        {% if form.username.errors %}
            <span class="error-message">{{ form.username.errors[0] }}</span>
        {% endif %}
    </div>
    
    <div class="form-group">
        <label for="password">密码</label>
        <div class="position-relative">
            <i class="fas fa-lock input-icon"></i>
            {{ form.password(class="form-control", id="password", placeholder="请输入您的密码") }}
            <i class="fas fa-eye password-toggle" id="togglePassword"></i>
        </div>
        {% if form.password.errors %}
            <span class="error-message">{{ form.password.errors[0] }}</span>
        {% endif %}
    </div>
    
    <div class="login-options">
        <div class="form-check">
            {{ form.remember(class="form-check-input", id="remember") }}
            <label class="form-check-label" for="remember">记住我</label>
        </div>
        
        <a href="#" class="forgot-password">忘记密码?</a>
    </div>
    
    <button type="submit" class="btn btn-login">
        <i class="fas fa-sign-in-alt"></i> 登录
    </button>
</form>
            
            <div class="social-login">
                <p>或使用其他方式登录</p>
                <div class="social-icons">
                    <a href="#" class="social-icon facebook">
                        <i class="fab fa-facebook-f"></i>
                    </a>
                    <a href="#" class="social-icon google">
                        <i class="fab fa-google"></i>
                    </a>
                    <a href="#" class="social-icon twitter">
                        <i class="fab fa-twitter"></i>
                    </a>
                </div>
            </div>
            
            <div class="register-link">
                还没有账号？<a href="{{ url_for('auth.register') }}">立即注册</a>
            </div>
            
            <i class="fas fa-film movie-icon"></i>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 密码显示/隐藏切换
        const togglePassword = document.querySelector('#togglePassword');
        const password = document.querySelector('#password');
        
        togglePassword.addEventListener('click', function () {
            const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
            password.setAttribute('type', type);
            this.classList.toggle('fa-eye-slash');
        });
        
        // 输入框聚焦效果
        const inputs = document.querySelectorAll('.form-control');
        inputs.forEach(input => {
            input.addEventListener('focus', function() {
                this.parentElement.querySelector('.input-icon').style.color = 'var(--primary-color)';
            });
            
            input.addEventListener('blur', function() {
                this.parentElement.querySelector('.input-icon').style.color = '#777';
            });
        });
        
        // 动画效果
        document.addEventListener('DOMContentLoaded', function() {
            const loginCard = document.querySelector('.login-card');
            loginCard.style.opacity = '0';
            loginCard.style.transform = 'translateY(30px)';
            
            setTimeout(() => {
                loginCard.style.transition = 'opacity 0.8s ease, transform 0.8s ease';
                loginCard.style.opacity = '1';
                loginCard.style.transform = 'translateY(0)';
            }, 300);
        });
    </script>
</body>
</html>